package josema.org.influenciasolar;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.*;
import android.widget.Toast;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId()) {
      case R.id.itemNew:
      	Intent intent = new Intent(this, DateActivity.class);
      	startActivity(intent);
        break;
        
      case R.id.itemPref:
    	  Toast.makeText(this, R.string.msgNoImplementado, Toast.LENGTH_SHORT)
          .show(); 
    	  break;
    	  
      default:
        break;
      }

      return true;
    }
    
        
    //
	// Button go to DATE input. 
    // Click on this open new Activity (DateActivity)
	//
    public void onClickStart(View view) {
    	// Create new intent
    	Intent intent = new Intent(this, DateActivity.class);    	
  	
    	// Start Activity
    	startActivity(intent);
    	
    }
}
